<!DOCTYPE html>
<html lang="zh-cn">
  <head>
    <meta http-equiv="Content-Type" content="text/html" charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />

    <meta name="renderer" content="webkit|ie-comp|ie-stand">

    <meta name="keywords" content="keywords" /><!--后期再强化arr和str模式-->
    <meta name="description" content="description" /><!--后期再强化arr和str模式-->
    <meta name="author" content="ltd" />

    <meta name="format-detection" content="telephone=no" />
    <meta name="format-detection" content="email=no" />
    <meta name="msapplication-tap-highlight" content="no" />

    <meta name="apple-touch-fullscreen" content="yes">
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <title>测试Storage用</title>
    <base target="_black">
  </head>
  <body>
    <table border="1" id="ls">
      <caption>测试localStorage用</caption>
      <thead>
        <tr><th>key</th><th>value</th><th>typeof</th></tr>
      </thead>
      <tbody id="showWLS">
        
      </tbody>
      <tfoot>
        <tr><td colspan="3">注意使用同源测试</td></tr>
      </tfoot>
    </table>
    <table border="1" id="ss">
      <caption>测试localStorage用</caption>
      <thead>
        <tr><th>key</th><th>value</th><th>typeof</th></tr>
      </thead>
      <tbody id="showWSS">
        
      </tbody>
      <tfoot>
        <tr><td colspan="3">注意使用同源测试</td></tr>
      </tfoot>
    </table>
    <script type="text/javascript">
      (function(){
        var wls = window.localStorage;
        var table = '';
        for(var k in wls){
          if (wls.hasOwnProperty(k)){
            table += '<tr><td>'+k+'</td><td>'+wls[k]+'</td><td>'+typeof wls[k]+'</td></tr>';
          }
        }
        document.getElementById('showWLS').innerHTML = table;
      })();
      (function(){
        var wss = window.sessionStorage;
        var table = '';
        for(var k in wss){
          if (wss.hasOwnProperty(k)){
            table += '<tr><td>'+k+'</td><td>'+wss[k]+'</td><td>'+typeof wss[k]+'</td></tr>';
          }
        }
        document.getElementById('showWSS').innerHTML = table;
      })();
    </script>
  </body>
</html>
